@extends('admin.common.list')
@section('content')

<section class="Hui-article-box">
	<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 文章管理 <span class="c-gray en">&gt;</span> 文章列表 <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a></nav>
		
	<div class="Hui-article">
		<article class="cl pd-20">
			<div class="text-c">
				<form class="Huiform" >
					<input type="text" placeholder="文章名称" name="title" value="{{isset($get['title'])?$get['title']:'' }}" class="input-text" style="width:200px">
				
					<span class="select-box" style="width:150px">
					<select class="select" name="category_id" size="1">
						<option  value="">选择分类</option>
						@foreach($categoryList  as $k => $v)
						<option  value="{{$v['id']}}" {{isset($get['category_id']) && $get['category_id']==$v['id'] ?'selected':'' }}>{{$v['title']}}</option>
						@endforeach
					</select>
					</span>
					<button  class="btn btn-primary upload-btn"><i class="Hui-iconfont">&#xe665;</i> 搜索</button>

				</form>
			</div>

			<div class="cl pd-5 bg-1 bk-gray mt-20"> 
				<a class="btn btn-primary radius" href="javascript:;" onclick="addHtml('添加文章','{{url('admin/article/create')}}','1400','880')"><i class="Hui-iconfont"></i> 添加文章</a>
				<span class="r">共有数据：<strong>{{$count}}</strong> 条</span> </div>
			<div class="mt-10">
				<table class="table table-border table-bordered table-bg table-sort">
					<thead>
						<tr class="text-c">
							<th width="70">ID</th>
							<th width="80">分类</th>
							<th width="200">标题</th>
							<th width="120">点击率</th>
							<th>是否推荐</th>
							<th>回复帖子</th>
							<th>创建时间</th>
							<th>修改时间</th>
							<th width="100">操作</th>
						</tr>
					</thead>
					<tbody>
						@foreach($articleList as $k => $v)
						<tr class="text-c">
							<td>{{$v['id']}}</td>
							<td>{{$v->category->title}}</td>
							<td>{{$v['title']}}</td>
							<td>{{$v['click']}}</td>
							<td>{{$v->isRecommend()}}</td>
							<td>{{$v->repliesCount()}}</td>
							<td>{{$v->created_at}}</td>
							<td>{{$v->updated_at}}</td>
							<td class="f-14 product-brand-manage">
								<a style="text-decoration:none"  onClick="addHtml('帖子列表','{{url('admin/replies')}}?article_id={{$v['id']}}','1400','880')" href="javascript:;" title="阅读帖子">
									<i class="Hui-iconfont">&#xe6b3;</i>
								</a>

								<a style="text-decoration:none" onClick="addHtml('编辑文章','{{url('admin/article',[$v['id'],'edit'])}}','1400','880')" href="javascript:;" title="编辑">
									<i class="Hui-iconfont">&#xe6df;</i>
								</a> 
								<a style="text-decoration:none" class="ml-5" onClick="delData('{{url('admin/article',[$v['id']])}}')" href="javascript:;" title="删除">
									<i class="Hui-iconfont">&#xe6e2;</i>
								</a>

							</td>
						</tr>
						@endforeach
					</tbody>
				</table>
				{{$articleList->render() }}
			</div>
		</article>
	</div>
</section>


@endsection